$(function () {
    $("#jqGrid").jqGrid({
        url: baseURL + 'frame/operationlog/list',
        datatype: "json",
        colModel: [
            { label: '操作用户', name: 'operateusername', index: "operateusername", width: 45},
            { label: '操作类型', name: 'operatetype', index: "operatetype", width: 75 },
            { label: '操作时间', name: 'operatedate', sortable: false, width: 75 },
            { label: '部门名称', name: 'ouname', width: 100 },
            { label: '操作信息', name: 'operatemessage', width: 100 }
        ],
        viewrecords: true,
        height: 385,
        rowNum: 10,
        rowList : [10,30,50],
        rownumbers: true,
        rownumWidth: 25,
        autowidth:true,
        multiselect: false,
        pager: "#jqGridPager",
        jsonReader : {
            root: "page.list",
            page: "page.currPage",
            total: "page.totalPage",
            records: "page.totalCount"
        },
        prmNames : {
            page:"page",
            rows:"limit",
            order: "order"
        },
        gridComplete:function(){
            //隐藏grid底部滚动条
            $("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
        }
    });
});




var vm = new Vue({
    el:'#rrapp',
    data:{
        q:{
            roleName: null
        },
        showList: true,
        title:null,
        role:{
            deptId:null,
            deptName:null
        }
    },
    methods: {
        query: function () {
            vm.reload();
        },
        reload: function () {
            vm.showList = true;
            var page = $("#jqGrid").jqGrid('getGridParam','page');
            $("#jqGrid").jqGrid('setGridParam',{
                postData:{'operateusername': vm.q.operateusername},
                page:page
            }).trigger("reloadGrid");
        }
    }
});